package com.sh.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sh.common.BaseResult;
import com.sh.entity.ApplicableType;
import com.sh.service.IApplicableTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 算子适用类型 前端控制器
 * </p>
 *
 * @author zhenlan
 * @since 2024-07-10
 */
@RestController
@RequestMapping("/applicableType")
public class ApplicableTypeController {

    @Autowired
    private IApplicableTypeService applicableTypeService;

    @RequestMapping("/list/{subjectId}")
    public BaseResult list(@PathVariable("subjectId") Integer subjectId) {
        return BaseResult.success(applicableTypeService.list(new QueryWrapper<ApplicableType>().eq("subject_id", subjectId).orderByAsc("ord")));
    }

}
